# Importing Data
AUSTRIA<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Steel/TSA.xlsx",sheet = "Sheet1", range = "D1:D239")

# Checking the Imported Data
View(AUSTRIA)
# Creating Time Series Data
Austria_ts <- ts(AUSTRIA, start=c(2000,1), end=c(2019,09), frequency=12)
# Viewing and Checking the Created Time Series Data
Austria_ts
sum(is.na(Austria_ts))
library(forecast)
Austria_ts <- tsclean(Austria_ts)
Austria_ts

# Identification: Plotting the Time Series Data
plot(Austria_ts)

# Estimating the appropriate model
Austria_ts_model <- auto.arima(Austria_ts)
Austria_ts_model

# Forecasting
options(max.print=1000000)
Austria_ts_forecast <- forecast (Austria_ts_model, level=c(95), h=255)
plot(Austria_ts_forecast)
Austria_ts_forecast             

# Exporting
write.table(Austria_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Steel/AUSTRIA_TSA.csv", sep=",")
